#ifndef MY_GTC_DIALOG_H
#define MY_GTC_DIALOG_H

#ifdef WINCE
#include <windows.h>
#include <winbase.h>
#include <winuser.h>
#include <MzCommon.h>
#include <mzfc_inc.h>
#include "shellnotifymsg.h"
#include "TouchNotifyApi.h"
#include "ShellNotifyMsg.h"
#include "callNotifyApi.h"
#include "acc_api.h"
#include <sipapi.h>
#endif

#include <QApplication>
#include <QNetworkCookie>
#include <QNetworkDiskCache>
#include <QtGui>
#include <QEvent>
#include <QDialog>
#include <QWebFrame>
#include <QWebPage>
#include <QPainter>
#include <QSize>
#include "ui_gtc.h"
#include "mb_cookies.h"

class my_gtc_dialog : public QDialog, public Ui::GoToCellDialog
{
    Q_OBJECT

public:
    my_gtc_dialog(QWidget *parent = 0);
#ifdef WINCE
    ~my_gtc_dialog()
    { 
        //ShowMzTopBar(); 
    };
#endif

protected:
    void mouseDoubleClickEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void showEvent(QShowEvent *event);
    bool eventFilter(QObject *target, QEvent *event);
    void inputMethodEvent(QInputMethodEvent *event);

    bool check_network(bool);

public slots:
    void up_link_string(QString);
    bool set_css_style(QString);

private slots:
    void up_link(QUrl);
    void up_link_show(QUrl);
    void goto_url();
    void load_over(bool);
    void up_progress(int pro);
    void mb_showkb(bool);

private:
    QPoint click_pt;
    int drag_x;
    int drag_y;
    bool in_drag;
    bool in_zoom;
    quint64 total_trans;

    QNetworkCookieJar *cookies;
};

inline bool check_map_url(QString url)
{
    Qt::CaseSensitivity cs;
    cs = Qt::CaseInsensitive;
    if((url.contains("ditu", cs)) ||
       (url.contains("map", cs)) ||
       (url.contains("gm.htm", cs)))
    {
        return false;
    }
    else
    {
        return true;
    }
}

#endif // MY_GTC_DIALOG_H
